const random = (state:Number,end:Number)=>{
    const p = Math.random()
    return Math.floor(start*(1-p)+end*p)
}


async function main({ params }: Args): Promise<Output> {
    // 构建输出对象
    if(params.position==null){
        params.position=random(0,3)
    }
    if(params.shooting_hand==null){
        params.shooting_hand=random(0,2)
    }

    const style = params.style || '写实'
    const uniform_color = params.uniform_color || '红色'
    const position = params.position == 0 ? '守门员' : (params.position == 1 ? '前锋' : "后卫")
    const shooting_hand = params.shooting_hand == 0 ? '左手' : '右手'
    const uniform_number = params.uniform_number || 10

    const ret = {
        style,
        uniform_color,
        position,
        shooting_hand,
        uniform_number,
    };

    return ret;
}